import java.util.Scanner;

public class 计算图形面积1 {
    public static void main(String[] args) {
        triangle();
        square();
        rectangle();
    }

    public static void triangle() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入三角形的底长：");
        double a = scanner.nextDouble();
        System.out.println("请输入三角形的高：");
        double b = scanner.nextDouble();
        double area = (a * b) / 2;
        System.out.println("三角形的面积为：" + area);
    }

    public static void square() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入正方形的长：");
        double a = scanner.nextDouble();
        System.out.println("请输入正方形的宽：");
        double b = scanner.nextDouble();
        double area = a * b;
        System.out.println("正方形的面积为：" + area);
    }

    public static void rectangle() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入长方形的长：");
        double a = scanner.nextDouble();
        System.out.println("请输入长方形的宽：");
        double b = scanner.nextDouble();
        double area = a * b;
        System.out.println("长方形的面积为：" + area);
    }
}